//
//  HomeMainModel.m
//  ArtDog
//
//  Created by dllo on 16/9/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "HomeMainModel.h"
#import "HomeTopicList.h"
#import "HomeExhibitList.h"
#import "HomeLabelList.h"
#import "HomeExhibitWorkList.h"
#import "HomeGalleryList.h"

@implementation HomeMainModel

- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"exhibitList"]) {
        NSMutableArray<HomeExhibitList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomeExhibitList *exhibitModel = [HomeExhibitList modelWithDic:dic];
            [array addObject:exhibitModel];
        }
        _exhibitList = array;
    } else if ([key isEqualToString:@"exhibitWorkList"]) {
        NSMutableArray<HomeExhibitWorkList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomeExhibitWorkList *exhibitWorkModel = [HomeExhibitWorkList modelWithDic:dic];
            [array addObject:exhibitWorkModel];
        }
        _exhibitWorkList = array;
        
    } else if ([key isEqualToString:@"galleryList"]) {
        NSMutableArray<HomeGalleryList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomeGalleryList *galleryModel = [HomeGalleryList modelWithDic:dic];
            [array addObject:galleryModel];
        }
        _galleryList = array;
        
    } else if ([key isEqualToString:@"labelList"]) {
        NSMutableArray<HomeLabelList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
        HomeLabelList *labelModel = [HomeLabelList modelWithDic:dic];
            [array addObject:labelModel];
        }
        _labelList = array;
        
    } else if ([key isEqualToString:@"topicList"]) {
        NSMutableArray<HomeTopicList *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            HomeTopicList *topicModel = [HomeTopicList modelWithDic:dic];
            [array addObject:topicModel];
        }
        _topicList = array;
        
    }
    
}

@end
